package com.hky.algorithm.realize;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.Objects;

/**
 * 玩家
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Player {
    public int cards_num; // 剩余牌数量
    public boolean alreadyHu = false; // 是否已经胡牌
    public Type lack; // 缺牌类型

    public Player(int cards_num, boolean alreadyHu) {
        this.cards_num = cards_num;
        this.alreadyHu = alreadyHu;
    }

    /**
     * 使用string来赋值枚举类型的lack
     *
     * @param cards_num 剩余牌数量
     * @param alreadyHu      是否已经胡牌，已经胡牌=true
     * @param lack      缺牌类型
     */
    public Player(int cards_num, boolean alreadyHu, String lack) {
        this.cards_num = cards_num;
        this.alreadyHu = alreadyHu;
        this.lack = Type.valueOf(lack);
    }
}
